package cn.bdqn.androidproject02;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;

public class MainActivity extends AppCompatActivity {
    private static  final String TAG="info";

    //Activity的生命周期
    //1.实例化oncreat()——onStart()启动——onREsume()交互——onPause()挂起——onStop()停止——onRestart()重启——onDestroy()销毁
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //可以加log日志
        Log.i(TAG,"实例化");

    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.i(TAG,"启动");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.i(TAG,"交互");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.i(TAG,"挂起");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.i(TAG,"停止");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.i(TAG,"重启");
    }
    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.i(TAG, "销毁");
    }
}
